﻿@model List<GameSchool.Models.ViewModels.NewsItemViewModel>

<link rel="stylesheet" type="text/css" href="/Content/css/forms.css" />
<fieldset>
            <legend>Fréttayfirlit</legend>
           
<table >
<tr><th>Titill</th><th>Áfangi</th><th>Dagsetning</th><th>Höfundur</th><th>Breyta frétt</th><th>Eyða frétt</th></tr>
@foreach (var m in Model)
{
    <tr class="newsItemList">
            <td>@m.Title</td>
            <td>@m.Course</td>
            <td>@m.date</td>  
            <td>@m.Author</td>           
            <td class="editLink">@Html.ActionLink("Breyta frétt", "Edit/" + @m.ID, "News")</td>
            <td class="editLink">@Html.ActionLink("Eyða frétt", "Delete/" + @m.ID, "News")</td>
    </tr>
}
</table>@if (Roles.IsUserInRole("Admin"))
{                 
                 <a href="@Url.Action("Bæta við frétt", "Create")"><button class="backbuttonNews">Bæta við frétt</button></a>            
}
                 <a href="@Url.Action("Index", "Home")"><button class="backbuttonNews">Til baka</button></a>
     
</fieldset>
        
                    



